cody - HTMLify profile

cody
4270 Files
632693 Views
Latest files of /cody/swapnilsparsh/30DaysOfJavaScript/114 - Weight Converter
html{
height: 100%;
}
body{
background: linear-gradient(to right, #8f2d7b, #8894a2);
color: white;
font-family: Arial, Helvetica, sans-serif;
}
height: 100%;
}
body{
background: linear-gradient(to right, #8f2d7b, #8894a2);
color: white;
font-family: Arial, Helvetica, sans-serif;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Weight Converter🎱</title>
<link rel="stylesheet" href="style.css">
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Weight Converter🎱</title>
<link rel="stylesheet" href="style.css">
# Weight Converter 🎱 :
---
It's a simple Weight Converter which takes weight as 'grams' and convert into -> 'pound' , 'kg' , 'Ounces' , 'Stones'.
---
## Tech stack Used:
HTML5, CSS3, JavaScript
---
It's a simple Weight Converter which takes weight as 'grams' and convert into -> 'pound' , 'kg' , 'Ounces' , 'Stones'.
---
## Tech stack Used:
HTML5, CSS3, JavaScript
let button = document.getElementById('btn');
button.addEventListener('click', function(){
const gram = parseInt(document.getElementById('grams').value);
const type = document.getElementById('type').value;
if(gram === '' || isNaN(gram)){
document.getElementById('grams').focus();
button.addEventListener('click', function(){
const gram = parseInt(document.getElementById('grams').value);
const type = document.getElementById('type').value;
if(gram === '' || isNaN(gram)){
document.getElementById('grams').focus();